<?php

class Migration_CreateOAuthScopesTable extends CI_Migration
{
	public function up()
	{
		$this->dbforge->add_field([
			'id' => [
				'type' => 'int',
				'auto_increment' => true,
				'null' => false
			],
			'scope' => [
				'type' => 'varchar',
				'constraint' => 255
			],
			'is_default' => [
				'type' => 'boolean',
			]
		])
		->add_key('id', true)
		->create_table('oauth_scopes');
	}

	public function down()
	{
		$this->dbforge->drop_table('oauth_scopes', true);
	}
}